package com.celesea.mongo.controller;

import com.celesea.mongo.bean.PrimaryMongoObject;
import com.celesea.mongo.dao.PrimaryRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * Created by Administrator on 2017/7/11.
 */
@RestController
@RequestMapping(value = "/mongo")
public class PrimaryMongoController {
    @Autowired
    private PrimaryRepository primaryRepository;

    @RequestMapping(value = "/list")
    public List<PrimaryMongoObject> list(){
        return primaryRepository.findAll();
    }

}
